import request from "@/utils/request";

// 获取省市县
const COMMON_BASE_URL = "/admin/region";

const CommonAPI = {
    /**
     * 获取省市县
     * @param
     * @returns
     */
    getDistrictList(queryParams: any) {
        return request<any, any>({
            url: `${COMMON_BASE_URL}/getDistrictList`,
            method: "get",
            params: queryParams,
        });
    },
    /**
     * 获取镇
     * @param
     * @returns
     */
    getTownList(queryParams: any) {
        return request<any, any>({
            url: `${COMMON_BASE_URL}/getTownList`,
            method: "get",
            params: queryParams,
        });
    },
    /**
     * 获取村
     * @param
     * @returns
     */
    getVillageList(queryParams: any) {
        return request<any, any>({
            url: `${COMMON_BASE_URL}/getVillageList`,
            method: "get",
            params: queryParams,
        });
    },
};

export default CommonAPI;
